import Vue from 'vue'
import VueRouter from 'vue-router'

import LOGO from '@/components/lunbodesc.vue'
import MAIN from '@/components/detial.vue'

// import HomeView from '../views/HomeView.vue'

Vue.use(VueRouter)

const routes = [
  {
    path:'/',
    component:()=>import('@/views/index')
  },
  {
    path: '/logo',
    name: 'logo',
    component: ()=>import('@/components/logo')
  },
  {
    path: '/axios',
    name: 'axios',
    component: ()=>import('@/views/axios.vue')
  },
  {
    path:'/Crs',
    name:'Crs',
    component:()=>import('@/components/Crs')
  },
  {
    path: '/lunbodesc/:advid', // 注意这里的 ':advid' 是一个动态参数
    name: 'lunbodesc',
    components:{
      default:LOGO
    } // lunbodesc 组件的位置
  },
  {
    path: '/detial/:aid', // 注意这里的 ':advid' 是一个动态参数
    name: 'detial',
    components:{
      default:MAIN
    } // lunbodesc 组件的位置
  },
  {
    path:'/login',
    name:'login',
    component:()=>import("@/components/login")
  }
]

const router = new VueRouter({
  mode: 'history',
  base: process.env.BASE_URL,
  routes
})

export default router
